package com.jumi.microservice.dto.finance;

import com.jumi.microservice.common.exception.BaseException;
import com.jumi.microservice.common.page.PageDomain;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

/**
 * @author by mazhao
 * @Classname GoodsSaleDetailRequest
 * @Description TODO
 * @Date 2020/9/16 15:57
 */
public class GoodsSaleDetailRequest extends PageDomain {

    @ApiModelProperty("商品名称")
    private String goodsName;
    @ApiModelProperty("商品状态")
    private Byte goodsStatus;
    @ApiModelProperty("供应商ID")
    private Integer supplierId;
    @ApiModelProperty("仓库ID")
    private Integer warehouseId;
    @ApiModelProperty("下单开始时间")
    private Date orderCreateStartTime;
    @ApiModelProperty("下单结束时间")
    private Date orderCreateEndTime;
    @ApiModelProperty("订单编号")
    private String orderNo;
    @ApiModelProperty("物料名称")
    private String materialsName;
    @ApiModelProperty("售后状态")
    private Byte afterSaleStatus;

    @Override
    public void checkRequest() {
        if(this.goodsName==null &&
        this.goodsStatus==null &&
        this.supplierId==null &&
        this.warehouseId==null &&
        this.orderCreateStartTime==null &&
        this.orderCreateEndTime==null &&
        this.orderNo==null &&
        this.materialsName==null &&
        this.afterSaleStatus==null){
            throw new BaseException(500,"请先选择搜索条件");
        }
    }

    public Byte getAfterSaleStatus() {
        return afterSaleStatus;
    }

    public void setAfterSaleStatus(Byte afterSaleStatus) {
        this.afterSaleStatus = afterSaleStatus;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Byte getGoodsStatus() {
        return goodsStatus;
    }

    public void setGoodsStatus(Byte goodsStatus) {
        this.goodsStatus = goodsStatus;
    }

    public Integer getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Integer supplierId) {
        this.supplierId = supplierId;
    }

    public Integer getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(Integer warehouseId) {
        this.warehouseId = warehouseId;
    }

    public Date getOrderCreateStartTime() {
        return orderCreateStartTime;
    }

    public void setOrderCreateStartTime(Date orderCreateStartTime) {
        this.orderCreateStartTime = orderCreateStartTime;
    }

    public Date getOrderCreateEndTime() {
        return orderCreateEndTime;
    }

    public void setOrderCreateEndTime(Date orderCreateEndTime) {
        this.orderCreateEndTime = orderCreateEndTime;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getMaterialsName() {
        return materialsName;
    }

    public void setMaterialsName(String materialsName) {
        this.materialsName = materialsName;
    }
}
